home *** CD-ROM | disk | FTP | other *** search
/ Clickx 47 / Clickx 47.iso / assets / software / Miro_Installer.exe / Miro_Downloader.exe / compiled_templates / download_item_inner.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2008-01-10  |  26.0 KB  |  340 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.5)
  3.  
  4. from template import Handle, fillAttr, quoteAndFillAttr, fillStaticTemplate
  5. from StringIO import StringIO
  6. from xhtmltools import urlencode
  7. from templatehelper import quoteattr, escape
  8. from string import Template
  9. import app
  10. import views
  11. import sorts
  12. import indexes
  13. import filters
  14. import resources
  15. import gtcache
  16. _ = gtcache.gettext
  17.  
  18. def fillTemplate(domHandler, dtvPlatform, eventCookie, bodyTagExtra, *args, **kargs):
  19.     this = kargs['this']
  20.     viewName = kargs['viewName']
  21.     localvars = locals()
  22.     localvars.update(globals())
  23.     handle = Handle(domHandler, localvars, onUnlink = (lambda : None))
  24.     localvars = locals()
  25.     localvars.update(globals())
  26.     handle_0 = Handle(domHandler, localvars, onUnlink = (lambda : None))
  27.     handle.addSubHandle(handle_0)
  28.     localvars = locals()
  29.     localvars.update(globals())
  30.     handle_1 = Handle(domHandler, localvars, onUnlink = (lambda : None))
  31.     handle.addSubHandle(handle_1)
  32.     localvars = locals()
  33.     localvars.update(globals())
  34.     handle_2 = Handle(domHandler, localvars, onUnlink = (lambda : None))
  35.     handle.addSubHandle(handle_2)
  36.     out = StringIO()
  37.     out.write(u'<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n')
  38.     out.write(u'<html dtvPlatform="')
  39.     out.write(quoteattr(urlencode(dtvPlatform)))
  40.     out.write(u'" eventCookie="')
  41.     out.write(quoteattr(urlencode(eventCookie)))
  42.     out.write(u'" xmlns:t="http://www.participatorypolitics.org/" xmlns="http://www.w3.org/1999/xhtml" xmlns:i18n="http://www.participatoryculture.org/i18n">\n    <head>\n        <meta content="text/html; charset=utf-8" http-equiv="content-type"></meta>\n        <script type="text/javascript">\n<!-- // Protect from our XML parser, which doesn\'t know to protect <script>\n\n///////////////////////////////////////////////////////////////////////////////\n//// For use on your page                                                  ////\n///////////////////////////////////////////////////////////////////////////////\n\nfunction getDTVPlatform() {\n    var elt = document.getElementsByTagName("html")[0];\n    return elt.getAttribute(\'dtvPlatform\');\n}\n\nfunction loadURL(url) {\n    try {\n        document.location.href = url;\n    } catch (e) {\n        // This may happen if the backend decides to handle the url load\n        // itself.\n    }\n}\n\n// For calling from page Javascript: Cause a URL to be loaded. The\n// assumption is that the application will notice, abort the load, and\n// take some action based on the URL.\nfunction eventURL(url) {\n    if (typeof(window.frontend) == \'undefined\') {\n\t// Generic strategy: trigger a load, and hope the application\n\t// catches it and cancels it without creating a race\n\t// condition.\n        loadURL(url)\n    } else {\n\t// OS X WebKit (KHTML) strategy: pass in an Objective C object\n\t// through the window object and call a method on it.\n\twindow.frontend.eventURL(url);\n    }\n\n    return false;\n}\n\n// Calls eventURL, then calls event.stopPropagation() and\n// event.preventDefault() so that the event chain is stopped.\nfunction eventURLAndStop(url, event) {\n  eventURL(url);\n  event.stopPropagation();\n  event.preventDefault();\n}\n\nfunction recommendItem(title, url) {\n    loadURL(\'http://www.videobomb.com/index/democracyemail?url=\' + \n            url + \'&title=\' + title);\n    return false;\n}\n\nfunction recommendChannel(title, url) {\n    // See also app.py if changing this URL\n    loadURL(\'http://www.videobomb.com/democracy_channel/email_friend\' +\n        \'?url=\' + url + \'&title=\' + title);\n    return false;\n}\n\n// Start the video player. The playlist will be the items in the view\n// named by viewName. If firstItemId is the id of an item in the view,\n// playback will start on that item; otherwise playback will start on\n// the first item.\nfunction playViewNamed(viewName, firstItemId) {\n    url = \'action:playViewNamed?\';\n    url = url + \'viewName=\' + URLencode(viewName);\n    url = url + \'&firstItemId=\' + URLencode(firstItemId);\n    eventURL(url);\n    return false;\n}\n\n// You can make \'incremental search\' text boxes on your page that\n// effectively tie the text box to the \'parameter\' argument of setViewFilter,\n// with the other argumens fixed. To do this, add these two attributes to\n// the text box:\n//   onfocus="startEditSearch(this)"\n//   onblur="endEditFilter()"\n// replacing the arguments in parentheses with the desired strings.\n//\n// You\'ll also need to provide a updateSearchString function at the\n// top of your template to perform the actual update\n\nvar editSearchField = null;\nvar editSearchOldValue = \'\';\nvar editSearchTimer = null;\nvar editSearchCallback = null;\n\nfunction onSearchFocus(obj){\n  if (obj.getAttribute(\'searching\') != \'1\') {\n\tobj.value="";\n\tobj.searching = \'1\';\n  }\n  startEditSearch(obj, null);\n}\n\nfunction startEditSearch(obj, callback) {\n  editSearchOldValue = obj.value;\n\n  editSearchField = obj;\n  editSearchCallback = callback;\n  editSearchTimerTick();\n}\n\nfunction editSearchUpdate() {\n    value = editSearchField.value;\n    if (editSearchOldValue != value) {\n\turl = \'action:setSearchString?searchString=\' + URLencode(value);\n\teventURL(url);\n\teditSearchOldValue = value;\n\tif(editSearchCallback) editSearchCallback();\n    }\n}\n\nfunction editSearchTimerTick() {\n    editSearchUpdate();\n    editSearchTimer = setTimeout(editSearchTimerTick, 50);\n}\n\nfunction endEditSearch() {\n  clearTimeout(editSearchTimer);\n  editSearchUpdate();\n}\n\n// Internal use: \'URL encode\' the given string.\nfunction URLencode(str) {\n    return encodeURIComponent(str)\n}\n\nfunction URLdecode(str) {\n  return decodeURIComponent(str)\n}\n\nvar currentSelectBoxMenu = null;\nfunction showSelectBoxMenu(id) {\n    document.getElementById(id).style.display = \'block\';\n    currentSelectBoxMenu = id;\n    document.addEventListener(\'click\', hideSelectBoxMenu, true)\n}\n\nfunction hideSelectBoxMenu(event) {\n    document.getElementById(currentSelectBoxMenu).style.display = \'\';\n    currentSelectBoxMenu = null;\n    document.removeEventListener(\'click\', hideSelectBoxMenu, true)\n}\n\n///////////////////////////////////////////////////////////////////////////////\n//// For calling by host templating code                                   ////\n///////////////////////////////////////////////////////////////////////////////\n\n// For calling by host templating code: Set CSS styles on the item\n// with the given ID to make it disappear.\nfunction hideItem(id) {\n    elt = document.getElementById(id);\n    elt.style.display = \'none\';\n    forceRedisplay(elt);\n}\n\n// For calling by host templating code: Set CSS styles on the item\n// with the given ID to make it visible if it was previously hidden.\nfunction showItem(id) {\n    elt = document.getElementById(id);\n    elt.style.display = \'\';\n    forceRedisplay(elt);\n}\n\n// For calling by host templating code: Replace the item with the\n// given id with the element described by the proided XML.\nfunction changeItem(id, newXML) {\n    elt = document.getElementById(id);\n    r = document.createRange();\n    r.selectNode(elt);\n    frag = r.createContextualFragment(newXML);\n    elt.parentNode.replaceChild(frag, elt);\n}\n\n// For calling by host templating code: Parse the XML in newXML into a\n// new element, and insert the new element immediately before the item\n// with the given id, such that the newly inserted item has the same\n// parent.\nfunction addItemBefore(newXML, id) {\n    elt = document.getElementById(id);\n    r = document.createRange();\n    r.selectNode(elt);\n    frag = r.createContextualFragment(newXML);\n    elt.parentNode.insertBefore(frag, elt);\n}    \n\n// For calling by host templating code: Parse the XML in newXML into a\n// new element, and insert the new element as the final child of the\n// item with the given id.\nfunction addItemAtEnd(newXML, id) {\n    elt = document.getElementById(id);\n    r = document.createRange();\n    r.selectNode(elt);\n    frag = r.createContextualFragment(newXML);\n    elt.insertBefore(frag, null);\n}    \n\n// For calling by host templating code: Remove the item with the given\n// id.\nfunction removeItem(id) {\n    elt = document.getElementById(id);\n    elt.parentNode.removeChild(elt);\n}    \n\n// Internal use: Sometime if all you do is change the style on a node,\n// Safari doesn\'t update the view until your mouse is next over the\n// window. Force the issue by making a drastic change in the vicinity\n// of the given element and then reversing it.\nfunction forceRedisplay(elt) {\n    r = document.createRange();\n    r.selectNode(elt);\n    frag = r.extractContents();\n    r.insertNode(frag);\n}\n\nfunction handleContextMenuSelect(event) {\n  if(event.button == 2) {\n    var area = event.currentTarget.getAttribute("selectArea");\n    var id = event.currentTarget.getAttribute("selectID");\n    var viewName = event.currentTarget.getAttribute("selectViewName");\n    var url = \'action:handleContextMenuSelect?id=\' + id + \'&area=\' + area +\n              \'&viewName=\' + viewName;\n    eventURL(url);\n  }\n  return true;\n}\n\nfunction handleSelect(event) {\n   if(event.target.tagName && event.target.tagName.toUpperCase() == \'A\') {\n       // Either a link in the descrption, or a bomb/mailto/trash click\n       return true;\n    }\n    var id = event.currentTarget.getAttribute("selectID");\n    var viewName = event.currentTarget.getAttribute("selectViewName");\n    var area = event.currentTarget.getAttribute("selectArea");\n    var shiftKey = \'0\';\n    var ctrlKey = \'0\';\n    if(event.shiftKey) shiftKey = \'1\';\n    if(event.ctrlKey || event.metaKey) ctrlKey = \'1\';\n    eventURL(\'action:handleSelect?area=\' + area + \'&viewName=\' + viewName + \n\t\'&id=\' + id + \'&shiftDown=\' + shiftKey + \'&ctrlDown=\' + ctrlKey);\n    return true;\n}\n\nfunction handleDblClick(event, viewName, id) {\n   var target = event.target;\n   while (target != undefined && target.ondblclick === null && target.tagName.toUpperCase() != \'A\') {\n       target = target.parentNode;\n   }\n\n   if(target.tagName.toUpperCase() == \'A\') {\n       // Either a link in the descrption, or a bomb/mailto/trash click\n       return true;\n   } else {\n       return eventURL(\'action:playViewNamed?viewName=\' + viewName + \n           \'&firstItemId=\' + id);\n   }\n}\n\nfunction getKeyFromEvent(evt) {\n  var key = 0;\n  if (window.event)  {\n    key = evt.keyCode;\n  } else if (evt.which) {\n  \tkey = evt.which;\n  }\n\n  return key;\n}\n\nfunction sendKeyToSearchBox(event) {\n  if(event.altKey || event.ctrlKey || event.metaKey ||\n      (event.target.tagName && event.target.tagName.toUpperCase() == \'INPUT\'))\n      return true;\n  var key = getKeyFromEvent(event);\n  if ((key == 33) || (key == 34) || (key == 35) || (key == 36) || \n      (key == 37) || (key == 38) || (key == 39) || (key == 40))\n      return true;\n  var searchBox = document.getElementById("search-box");\n  searchBox.focus();\n  return true;\n}\n\nfunction playNewVideos(event, id) {\n  eventURL(\'action:playNewVideos?id=\' + id);\n  event.stopPropagation(); // don\'t want handleSelect to deal with this event\n  return false;\n}\n\n///////////////////////////////////////////////////////////////////////////////\n///////////////////////////////////////////////////////////////////////////////\n\n-->\n</script>\n\n        \n    </head>\n    <body')
  43.     out.write(u' ' + bodyTagExtra)
  44.     out.write(u'>\n        <div class="dnd-reorder-line"></div>\n        ')
  45.     out.write(u'\n    <img src="')
  46.     out.write(quoteattr(this.getThumbnail()))
  47.     out.write(u'" alt="" class="main-video-tnail" id="video-tnail-')
  48.     out.write(quoteattr(viewName + str(this.getID())))
  49.     out.write(u'"></img>\n\n    <div class="main-video-hitbox">\n        ')
  50.     if not not this.isDownloadable():
  51.         out.write(u'<a href="#" class="icon download" onclick="return eventURL(\'action:startDownload?item=')
  52.         out.write(quoteattr(urlencode(this.getID())))
  53.         out.write(u'\');" title="Download \'')
  54.         out.write(quoteattr(this.getTitle()))
  55.         out.write(u'\'"></a>')
  56.     
  57.     out.write(u'\n        ')
  58.     if not not (this.getState() == 'paused'):
  59.         out.write(u'<a href="#" class="icon paused-circle" onclick="return eventURL(\'action:startDownload?item=')
  60.         out.write(quoteattr(urlencode(this.getID())))
  61.         out.write(u'\');" title="Download \'')
  62.         out.write(quoteattr(this.getTitle()))
  63.         out.write(u'\'"></a>')
  64.     
  65.     out.write(u'\n        ')
  66.     if not not (this.getState() == 'downloading'):
  67.         out.write(u'<span class="icon inprogress-background">\n            ')
  68.         if not this.isPendingManualDownload():
  69.             out.write(u'<img src="')
  70.             out.write(quoteattr(resources.url(u'images/main-video-inprogress-arrows.gif')))
  71.             out.write(u'" title="Downloading \'')
  72.             out.write(quoteattr(this.getTitle()))
  73.             out.write(u'\'" class="inprogress-arrows"></img>')
  74.         
  75.         out.write(u'\n            ')
  76.         if not not this.isPendingManualDownload():
  77.             out.write(u'<img src="')
  78.             out.write(quoteattr(resources.url(u'images/download-pending-dot.png')))
  79.             out.write(u'" class="download-pending-icon" title="Download Pending for \'')
  80.             out.write(quoteattr(this.getTitle()))
  81.             out.write(u'\'"></img>')
  82.         
  83.         out.write(u'\n        </span>')
  84.     
  85.     out.write(u'\n        ')
  86.     if not not this.isPlayable():
  87.         out.write(u'<a href="#" class="icon play" onclick="return eventURL(\'action:playViewNamed?viewName=')
  88.         out.write(quoteattr(urlencode(viewName)))
  89.         out.write(u'&firstItemId=')
  90.         out.write(quoteattr(urlencode(this.getID())))
  91.         out.write(u'\');" title="Play \'')
  92.         out.write(quoteattr(this.getTitle()))
  93.         out.write(u'\'"></a>')
  94.     
  95.     out.write(u'\n    </div>\n')
  96.     out.write(u'\n        ')
  97.     out.write(u'\n    <div class="main-video-details">\n        <div class="main-video-details-top">\n            <div class="details-link">\n                ')
  98.     if not this.showMoreInfo:
  99.         out.write(u'<div>\n                    <a href="#" onclick="return eventURL(\'action:toggleMoreItemInfo?item=')
  100.         out.write(quoteattr(urlencode(this.getID())))
  101.         out.write(u'\');"><span>')
  102.         out.write(_(u'Details'))
  103.         out.write(u'</span> <img src="')
  104.         out.write(quoteattr(resources.url(u'images/more-info-button.png')))
  105.         out.write(u'" alt=""></img></a>\n                </div>')
  106.     
  107.     out.write(u'\n\n                ')
  108.     if not not (this.showMoreInfo):
  109.         out.write(u'<div>\n                    <a href="#" onclick="return eventURL(\'action:toggleMoreItemInfo?item=')
  110.         out.write(quoteattr(urlencode(this.getID())))
  111.         out.write(u'\');"><span>')
  112.         out.write(_(u'Close'))
  113.         out.write(u'</span> <img src="')
  114.         out.write(quoteattr(resources.url(u'images/more-info-button-close.png')))
  115.         out.write(u'" alt=""></img></a>\n                </div>')
  116.     
  117.     out.write(u'\n            </div>\n            <div class="video-stats">\n                <div class="length">\n                    <span>')
  118.     out.write(escape(this.getDuration()))
  119.     out.write(u'</span>\n                </div>\n                <div class="date">\n                    ')
  120.     if not not (this.getReleaseDate() != ''):
  121.         out.write(u'<span><span>')
  122.         out.write(escape(this.getReleaseDate()))
  123.         out.write(u'</span></span>')
  124.     
  125.     out.write(u'\n                </div>\n\n                <div class="size">\n                    ')
  126.     if not this.getURL() != this.getLink() or this.getLink() != '':
  127.         pass
  128.     if not not this.isDownloaded():
  129.         out.write(u'<span><span>')
  130.         out.write(escape(this.getSizeForDisplay()))
  131.         out.write(u'</span></span>')
  132.     
  133.     out.write(u'\n                </div>\n                <div class="torrent">\n                    ')
  134.     if not not this.looksLikeTorrent():
  135.         out.write(u'<span>\n                        <span>')
  136.         out.write(_(u'.torrent'))
  137.         out.write(u'</span>\n                    </span>')
  138.     
  139.     out.write(u'\n                </div>\n           </div>\n        </div>\n\n        <div class="main-video-details-main">\n            <div class="details-buttons-right">\n                <div class="save-button-container">\n                    ')
  140.     if not not this.showSaveButton():
  141.         out.write(u'<div>\n                        <a href="#" class="round-button-left save" onclick="return eventURL(\'action:keepItem?item=')
  142.         out.write(quoteattr(urlencode(this.getID())))
  143.         out.write(u'\');">\n                        <div class="round-button-right">\n                        <div class="round-button-content">\n                            <span>')
  144.         out.write(_(u'KEEP'))
  145.         out.write(u'</span>\n                        </div>\n                        </div>\n                        </a>\n                    </div>')
  146.     
  147.     out.write(u'\n                    ')
  148.     if not not this.showSaved():
  149.         out.write(u'<div class="saved-note">SAVED</div>')
  150.     
  151.     out.write(u'\n                </div>\n                ')
  152.     if not not this.showTrashButton():
  153.         out.write(u'<div>\n                    <a href="#" class="round-button-left delete" onclick="return eventURL(\'action:expireItem?item=')
  154.         out.write(quoteattr(urlencode(this.getID())))
  155.         out.write(u'\');">\n                    <div class="round-button-right">\n                    <div class="round-button-content">\n                        <span>')
  156.         out.write(_(u'DELETE'))
  157.         out.write(u'</span>\n                    </div>\n                    </div>\n                    </a>\n                </div>')
  158.     
  159.     out.write(u'\n            </div>\n\n            \n            ')
  160.     if not not this.hasSharableURL():
  161.         out.write(u'<div class="select-box-left share-box" onclick="showSelectBoxMenu(\'share-menu-')
  162.         out.write(quoteattr(urlencode(viewName)))
  163.         out.write(u'-')
  164.         out.write(quoteattr(urlencode(this.getID())))
  165.         out.write(u'\'); event.stopPropagation();">\n                <div class="select-box-right">\n                    <div class="select-box-mid">\n                        SHARE\n                    </div>\n                </div>\n            </div>')
  166.     
  167.     out.write(u'\n            <br class="clear"></br>\n            <ul id="share-menu-')
  168.     out.write(quoteattr(urlencode(viewName)))
  169.     out.write(u'-')
  170.     out.write(quoteattr(urlencode(this.getID())))
  171.     out.write(u'" class="select-box-menu share-menu">\n                <li>\n                    <a href="#" class="main-video-details-task-mail" onclick="return recommendItem(\'')
  172.     out.write(quoteattr(urlencode(this.getTitle())))
  173.     out.write(u"', '")
  174.     out.write(quoteattr(urlencode(this.getURL())))
  175.     out.write(u"', '")
  176.     out.write(quoteattr(urlencode(this.getFeed().getURL())))
  177.     out.write(u'\');">\n                        <img src="')
  178.     out.write(quoteattr(resources.url(u'images/email-a-friend.gif')))
  179.     out.write(u'" alt="email-a-friend icon"></img>\n                        <span>')
  180.     out.write(_(u'Email to a friend'))
  181.     out.write(u'</span>\n                    </a>\n                </li>\n                <li>\n                    <a href="#" class="main-video-details-task-bomb" onclick="return eventURL(\'action:videoBombExternally?item=')
  182.     out.write(quoteattr(urlencode(this.getID())))
  183.     out.write(u'\');">\n                        <img src="')
  184.     out.write(quoteattr(resources.url(u'images/videobomb.gif')))
  185.     out.write(u'" alt="videobomb icon"></img>\n                        <span>')
  186.     out.write(_(u'Post to Video Bomb'))
  187.     out.write(u'</span>\n                    </a>\n                </li>\n                <li>\n                    <a href="#" class="main-video-details-delicious" onclick="return eventURL(\'http://del.icio.us/post?v=4&noui&jump=close&url=')
  188.     out.write(quoteattr(urlencode(this.getURL())))
  189.     out.write(u'&title=')
  190.     out.write(quoteattr(urlencode(this.getTitle())))
  191.     out.write(u'\');">\n                        <img src="')
  192.     out.write(quoteattr(resources.url(u'images/delicious.gif')))
  193.     out.write(u'" alt="delicious icon"></img>\n                        <span>')
  194.     out.write(_(u'Post to del.icio.us'))
  195.     out.write(u'</span>\n                    </a>\n                </li>\n                <li>\n                    <a href="#" class="main-video-details-digg" onclick="return eventURL(\'http://www.digg.com/submit?phrase=2&url=')
  196.     out.write(quoteattr(urlencode(this.getQuotedURL())))
  197.     out.write(u'\');">\n                        <img src="')
  198.     out.write(quoteattr(resources.url(u'images/digg.gif')))
  199.     out.write(u'" alt="digg icon"></img>\n                        <span>')
  200.     out.write(_(u'Post to digg'))
  201.     out.write(u'</span>\n                    </a>\n                </li>\n                <li>\n                    <a href="#" class="main-video-details-reddit" onclick="return eventURL(\'http://reddit.com/submit?url=')
  202.     out.write(quoteattr(urlencode(this.getQuotedURL())))
  203.     out.write(u'&title=')
  204.     out.write(quoteattr(urlencode(this.getQuotedTitle())))
  205.     out.write(u'\');">\n                        <img src="')
  206.     out.write(quoteattr(resources.url(u'images/reddit.gif')))
  207.     out.write(u'" alt="reddit icon"></img>\n                        <span>')
  208.     out.write(_(u'Post to Reddit'))
  209.     out.write(u'</span>\n                    </a>\n                </li>\n            </ul>\n            <!-- HOT SPOT download-progress-')
  210.     out.write(quoteattr(viewName))
  211.     out.write(u'-')
  212.     out.write(quoteattr(this.getID()))
  213.     out.write(u' --><div id="download-progress-')
  214.     out.write(quoteattr(viewName))
  215.     out.write(u'-')
  216.     out.write(quoteattr(this.getID()))
  217.     out.write(u'">\n                ')
  218.     if not this.getState() not in ('downloading', 'paused'):
  219.         out.write(u'<div class="main-video-details-download-info">\n                    ')
  220.         if not not this.gotContentLength():
  221.             out.write(u'<div>\n                        <div class="main-progress-bar-bg">\n                            <div style="width: ')
  222.             out.write(quoteattr(this.downloadProgressWidth()))
  223.             out.write(u'px;" class="main-progress-bar"></div>\n                        </div>\n                    </div>')
  224.         
  225.         out.write(u'\n                    ')
  226.         if not this.gotContentLength():
  227.             out.write(u'<div>\n                        <div class="progress-throbber-bg">\n                            ')
  228.             if not not (this.downloadRate() != '0KB/s'):
  229.                 out.write(u'<span>\n                                <img src="')
  230.                 out.write(quoteattr(resources.url(u'images/progress-throbber.gif')))
  231.                 out.write(u'"></img>\n                            </span>')
  232.             
  233.             out.write(u'\n                            ')
  234.             if not not (this.downloadRate() == '0KB/s'):
  235.                 out.write(u'<span>\n                                <img src="')
  236.                 out.write(quoteattr(resources.url(u'images/progress-throbber-gray.png')))
  237.                 out.write(u'"></img>\n                            </span>')
  238.             
  239.             out.write(u'\n                        </div>\n                    </div>')
  240.         
  241.         out.write(u'\n                    ')
  242.         if not not (this.getState() == 'downloading'):
  243.             out.write(u'<div class="downloading">\n                        ')
  244.             if not not this.downloadInProgress():
  245.                 out.write(u'<div class="download-rate-and-eta">\n                            <span class="download-rate">')
  246.                 out.write(escape(this.downloadRate()))
  247.                 out.write(u'</span>\n                            <span>')
  248.                 out.write(escape(this.downloadETA()))
  249.                 out.write(u'</span>\n                        </div>')
  250.             
  251.             out.write(u'\n                        ')
  252.             if not this.downloadInProgress():
  253.                 out.write(u'<div>\n                            <span>')
  254.                 out.write(escape(this.getStartupActivity()))
  255.                 out.write(u'</span>\n                        </div>')
  256.             
  257.             out.write(u'\n                    </div>')
  258.         
  259.         out.write(u'\n                    ')
  260.         if not not (this.getState() == 'paused'):
  261.             out.write(u'<div class="paused">\n                        <span>')
  262.             out.write(escape(this.getPausedString()))
  263.             out.write(u'</span>\n                    </div>')
  264.         
  265.         out.write(u'\n                    ')
  266.         if not this.getState() == 'paused':
  267.             out.write(u'<a title="Pause Download" href="#" class="main-progress-pause" onclick="return eventURL(\'action:pauseDownload?item=')
  268.             out.write(quoteattr(urlencode(this.getID())))
  269.             out.write(u'\');"></a>')
  270.         
  271.         out.write(u'\n                    ')
  272.         if not not (this.getState() == 'paused'):
  273.             out.write(u'<a href="#" class="main-progress-resume" onclick="return eventURL(\'action:resumeDownload?item=')
  274.             out.write(quoteattr(urlencode(this.getID())))
  275.             out.write(u'\');" title="Pause Download"></a>')
  276.         
  277.         out.write(u'\n                    <a href="#" class="main-progress-cancel" onclick="return eventURL(\'action:expireItem?item=')
  278.         out.write(quoteattr(urlencode(this.getID())))
  279.         out.write(u'\');" title="Cancel Download"></a>\n                </div>')
  280.     
  281.     out.write(u'\n            </div><!-- HOT SPOT END -->\n            <div class="download-status-strings">\n                ')
  282.     if not not this.getExpiring():
  283.         out.write(u'<div class="main-video-details-expiring">\n                    <span>')
  284.         out.write(escape(this.getExpirationString()))
  285.         out.write(u'</span>\n                </div>')
  286.     
  287.     out.write(u'\n                ')
  288.     if not not this.isPendingAutoDownload():
  289.         out.write(u'<div class="main-video-details-pending-auto">\n                    <span>')
  290.         out.write(_(u'Pending Auto Download'))
  291.         out.write(u'</span>\n                </div>')
  292.     
  293.     out.write(u'\n                ')
  294.     if this.isFailedDownload():
  295.         pass
  296.     if not not (not this.isPendingManualDownload()):
  297.         out.write(u'<div class="main-video-details-failed-download">\n                    <span>')
  298.         out.write(escape(this.getFailureReason()))
  299.         out.write(u'</span>\n                </div>')
  300.     
  301.     out.write(u'\n            </div>\n            ')
  302.     if not this.getEmblemCSSString() == '':
  303.         out.write(u'<div class="video-state ')
  304.         out.write(quoteattr(this.getEmblemCSSClass()))
  305.         out.write(u'">\n                <div class="video-state-left">\n                    <div class="video-state-right">\n                        <span class="video-state-mid">\n                            <span>')
  306.         out.write(escape(this.getEmblemCSSString()))
  307.         out.write(u'</span>\n                        </span>\n                    </div>\n                </div>\n            </div>')
  308.     
  309.     out.write(u'\n            ')
  310.     if this.downloader:
  311.         pass
  312.     if not not (this.downloader.getState() == 'uploading'):
  313.         out.write(u'<div>\n                 <a href="#" class="round-button-left stop-seeding" onclick="return eventURL(\'action:stopUploadItem?item=')
  314.         out.write(quoteattr(urlencode(this.getID())))
  315.         out.write(u'\');">\n                <div class="round-button-right">\n                <div class="round-button-content">\n                    <span>')
  316.         out.write(_(u'STOP SEEDING'))
  317.         out.write(u'</span>\n                </div>\n                </div>\n                </a>\n            </div>')
  318.     
  319.     out.write(u'\n        </div>\n        ')
  320.     if not not (this.showMoreInfo):
  321.         out.write(u'<div class="more-info-details">\n            <div>')
  322.         out.write(this.getMoreInfo())
  323.         out.write(u'</div>\n        </div>')
  324.     
  325.     out.write(u'\n    </div>\n')
  326.     out.write(u'\n        ')
  327.     out.write(u'\n    <div class="main-video-desc noselect">\n        <h1 class="noselect">')
  328.     out.write(escape(this.getTitle()))
  329.     out.write(u'</h1>\n        <div class="main-video-desc-desc noselect">\n            <span>')
  330.     out.write(this.getDescription())
  331.     out.write(u'</span>\n        </div>\n        <div class="main-video-bottom">\n                <div class="channel-title">\n                        <span>')
  332.     out.write(escape(this.getChannelTitle()))
  333.     out.write(u'</span>\n                </div>\n                <div class="donate-html noselect">\n                    <span>')
  334.     out.write(this.getPaymentHTML())
  335.     out.write(u'</span>\n                </div>\n        </div>\n    </div>\n')
  336.     out.write(u'\n        <div class="clear"></div>\n    </body>\n</html>')
  337.     out.seek(0)
  338.     return (out, handle)
  339.  
  340.